<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2024/10/7
  Time: 17:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<% if(session.getAttribute("ifLogin").equals("null"))
{
    response.sendRedirect("login.jsp");
}
else {
    if(!(Boolean)session.getAttribute("ifLogin"))
    {
        response.sendRedirect("login.jsp");
    }
}
%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%  String info = (String)request.getAttribute("info");
    if(info != null){
        out.println("<p>"+info+"</p>");
    }
%>
<br>
<a href="addMessage.jsp">添加留言</a> <br>
<%
    @SuppressWarnings("unchecked")
    List<String> messages = (List<String>)session.getAttribute("messages");

    for (String message : messages) {
        out.println("<p>" + message + "</p>" + "<br>"); // 使用 println
    }

%>

</body>
</html>
